package com.hspedu.extends_.exercise;
//输出什么
public class ExtendsExercise02 {
    public static void main(String[] args) {
        Z z = new Z();
    }
}


class X{
    public X(){
        System.out.println("我是X类无参构造");
    }
}
class Y extends X{
    public Y(){
        System.out.println("我是Y类无参构造");
    }
    public Y(String name){
        System.out.println(name+ "我是Y类的有参构造");
    }
}

class Z extends Y{
    public Z(){
        this("hello");
        System.out.println("我是Z类无参构造");
    }
    public Z(String name){
        super("haha");
        System.out.println("我是Z类的有参构造");
    }
}
